package JDK8_Xinlocaldate;

import java.time.LocalDate;
import java.util.ArrayList;

public class Test {
    public static void main(String[] args) {
        ArrayList<LocalDate> day = new ArrayList<>();
        LocalDate locale = LocalDate.now();
        System.out.println( locale);
        LocalDate newday = locale.plusMonths(-1);
        day.add(newday);
        System.out.println( newday);

        while (newday.isBefore( locale)){
            newday = newday.plusDays(1);
            day.add(newday);
        }
        System.out.println( "一个月的时间："+day);
        System.out.println("==========");
        ArrayList<LocalDate> day1 = new ArrayList<>();
        for (int i = 0; i < 30; i++) {
            day1.add(locale.plusDays(-i));
        }
        System.out.println( "30天时间："+day1);

    }

}
